<?php
/**
 * Created by PhpStorm.
 * User: ybjaa
 * Date: 2017/4/19
 * Time: 15:46
 */

namespace App\Http\Controllers\Test;

use App\Business\BusBase;
use App\Business\DataLog\DataRequest;
use App\Business\Users\UserCreate;
use App\Extend\Test;
use App\Http\Controllers\Controller;
use App\Jobs\LogQueue;
use App\Units;
use database\model\base;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use SebastianBergmann\Environment\Console;

class TestController  extends Controller
{

    public function create()
    {
        (new UserCreate())->CreateUser();
    }

    public function getResult()
    {


        $array=DB::table("USERS")->get();


        return json_encode($array);
    }

    public function test1_old01()
    {
        dispatch(new LogQueue(new DataRequest()));
    }


    public function test1_old02()
    {
        $p="G:\users\ybjaa\documents\DaLiYiBao\storage\app\public/jssb/1.txt";
        $s=fopen($p,"w+b");

    }

    public function test1()
    {
        $array=[
            "a1"=>"\"asdf",
            "a2"=>"as\"aa\"ss"
        ];

        $obj=new \stdClass();
        $p="a1";
        $obj->$p = $array[$p];

    }

    public function test2()
    {



    }

    public function test2_old01()
    {



       /* new base();
        $test=new DataRequest();

        $aa1=Auth::attempt(["userName"=>'test1']);*/

       return Test::GetInstance()->getIndex();

    }




    public function getDir()
    {
        return __DIR__;
    }


    public function getAllBus()
    {
        return BusBase::GetAllBusinessClassNames();
    }

    public function getAllModel()
    {
        return base::GetAllModels();
    }
}